-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve msys2 compatibility #114
improve msys2 compatibility #114
Conversation
Introduce `libCZI_WINDOWSAPIAVAILABLE` to detect Windows-based build environments (WIN32, CYGWIN, MSYS, MINGW). Update `CMakeLists.txt` to set this variable and add messages indicating Windows API availability. Configure `libCZI_Config.h` to include `LIBCZI_WINDOWSAPI_AVAILABLE` macro. Replace `_WIN32` with `LIBCZI_WINDOWSAPI_AVAILABLE` for conditional compilation in multiple files: `StreamImpl.cpp`, `StreamImpl.h`, `windowsfileinputstream.cpp`, `windowsfileinputstream.h`, `decoder_wic.cpp`, `decoder_wic.h`, `libCZI.h`, `libCZI_Site.cpp`, and `utilities.cpp`. Ensure Windows-specific code is conditionally compiled based on `LIBCZI_WINDOWSAPI_AVAILABLE`, enhancing portability and maintainability.
Removed `stdafx.h` includes from multiple source files and deleted `stdafx.cpp`, `stdafx.h`, `targetver.h`, and `platform_defines.h`. Updated `CMakeLists.txt` to replace platform-specific checks with `LIBCZI_HAVE_WIN32_API` and set `CZICMD_WINDOWSAPIAVAILABLE` accordingly. Adjusted `CMakeLists.txt` to conditionally link Windows libraries and updated the `RapidJSON` Git tag. Replaced platform-specific macros with `CZICMD_WINDOWSAPI_AVAILABLE` in various source files. Added necessary includes to `consoleio.h`. Removed `#pragma once` and other preprocessor directives from multiple files.
The `CMakeLists.txt` file now includes a check to determine if the build is targeting a Windows platform and sets the `LIBCZI_HAVE_WIN32_API` variable accordingly. In `libCZI_Lib.cpp`, the preprocessor directive has been updated to use the new `LIBCZI_HAVE_WIN32_API` variable to conditionally compile the appropriate implementation of `CreateInputOutputStreamForFile`.
Set LIBCZI_BUILD_PREFER_EXTERNALPACKAGE_RAPIDJSON to OFF to ensure automatic download and build of RapidJSON. Added comments to clarify RapidJSON as a header-only library and noted issues with version 1.1.0 on GCC 14.2 with msys2. Using a later version from the master branch (commit 7c73dd7de7c4f14379b781418c6e947ad464c818).
Replaced the LINUXENV-based conditional inclusion of `libgen.h` with a more standard preprocessor check for non-Windows environments using `_WIN32`. This ensures `libgen.h` is included only when not compiling on Windows, improving code clarity and portability.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #114 +/- ##
==========================================
- Coverage 65.51% 65.50% -0.01%
==========================================
Files 86 86
Lines 10892 10893 +1
==========================================
Hits 7136 7136
- Misses 3756 3757 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
… 'icase' is not supported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool!
Description
Fixes #113
Type of change
How Has This Been Tested?
locally, building under msys2 and other platforms
Checklist: